/*
package com.bifrost.admin.controller;

import com.bifrost.entity.ScheduleJob;
import com.bifrost.model.ResultModel;
import com.bifrost.repository.ScheduleJobRepository;
import com.bifrost.util.ScheduleUtils;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/schedule")
public class AdminSchedulerController {

    @Autowired
    ScheduleJobRepository scheduleJobRepository;
    @Autowired
    Scheduler scheduler;

    @RequestMapping("/run/{id}")
    public ResultModel run(@PathVariable("id") Long id ){

        ScheduleJob scheduleJob  = scheduleJobRepository.findOne(id);
        Assert.notNull(scheduleJob,"scheduler not exists..");
        ScheduleUtils.run(scheduler,scheduleJob);
        return ResultModel.ok();
    }

    @RequestMapping("/pauseJob/{id}")
    public ResultModel pauseJob(@PathVariable("id") Long id ){

        ScheduleJob scheduleJob  = scheduleJobRepository.findOne(id);
        Assert.notNull(scheduleJob,"scheduler not exists..");
        ScheduleUtils.pauseJob(scheduler,id);
        return ResultModel.ok();
    }

    @RequestMapping("/resumeJob/{id}")
    public ResultModel resumeJob(@PathVariable("id") Long id ){

        ScheduleJob scheduleJob  = scheduleJobRepository.findOne(id);
        Assert.notNull(scheduleJob,"scheduler not exists..");
        ScheduleUtils.resumeJob(scheduler,id);
        return ResultModel.ok();
    }

    @RequestMapping("/deleteJob/{id}")
    public ResultModel deleteScheduleJob(@PathVariable("id") Long id ){

        ScheduleJob scheduleJob  = scheduleJobRepository.findOne(id);
        Assert.notNull(scheduleJob,"scheduler not exists..");
        ScheduleUtils.deleteScheduleJob(scheduler,id);
        return ResultModel.ok();
    }
}
*/
